$(document).ready(function() {
    dataSource = new kendo.data.DataSource({
        data: appBosch.records
    });
    $("#grid").kendoGrid({
        toolbar: [
            {
                name: "excel",
                text: "Exportar a Excel"
            },
            {
                name: "pdf",
                text: "Exportar a PDF"
            }
        ],
        excel: {
            allPages: true,
            fileName: "Certificaciones creadas.xlsx",
            filterable: true
        },
        pdf: {
            allPages: true,
            fileName: "Certificaciones creadas.pdf"
        },
        scrollable: true,
        filterable: true,
        selectable: true,
        navigatable: true,
        resizable: true,
        columnMenu: true,
        sortable: true,
        groupable: true,
        dataSource: dataSource,
        columns: [
            {
                field: "full_name", 
                title: "Usuario"
            },
            {
                field: "moe", 
                title: "MOE"
            },
            {
                field: "area", 
                title: "Area"
            },
            {
                field: "line", 
                title: "Línea"
            },
            {
                field: "workstation",
                title: "Operación"
            },
            {
                field: "asociado", 
                title: "Asociado"
            },
            {
                field: "log_creation_date", 
                title: "Fecha de certificación",
                template: '<span title="#=kendo.toString(new Date(log_creation_date.replace(/-/g, "/")), "D")">#=kendo.toString(new Date(log_creation_date.replace(/-/g, "/")), "d")#</span>'
            }
        ]
    });
});